from ronglian_sms_sdk import SmsSDK
import json

accId = '8aaf07087bc82708017bf7c734030e76'
accToken = '1315cd1da1b349bcb449e947290395f3'
appId = '8aaf07087bc82708017bf7c734de0e7d'


def send_message(mobile,code,time):
    sdk = SmsSDK(accId, accToken, appId)
    tid = '1'
    # mobile = '手机号1,手机号2'
    datas = (code, time)
    resp = sdk.sendMessage(tid, mobile, datas)
    result = json.loads(resp)
    if result['statusCode'] == '000000':
        return True
    return False

# redis连接
from django_redis import get_redis_connection
def get_redis():
    conn=get_redis_connection()
    return conn

